Method and apparatus for filling an image on a display screen

ABSTRACT

An apparatus for efficiently filling an image on a display screen through hardware acceleration are provided. One exemplary device includes a display controller. The display controller includes image generation circuitry configured to generate an address and a color for each pixel of an image to be drawn on a display screen. The image generation circuitry includes pen width selection circuitry configured to identify and select coordinates of adjacent and non-overlapping sectors to an initial footprint of the image on the display screen to be drawn. The display controller includes data processing and selection circuitry configured to interface with a central processing unit (CPU) and a memory. The data processing and selection circuitry in communication with the image generation circuitry and configured to receive the address and the color for each pixel of the image. A system and methods for filling an image on a display screen are also provided.

COPYRIGHT AUTHORIZATION

A portion of the disclosure of this patent document contains materialwhich is subject to copyright protection. The copyright owner has noobjection to the facsimile reproduction by anyone of the patent documentor the patent disclosure, as it appears in the Patent and TrademarkOffice patent file or records, but otherwise reserves all copyrightrights whatsoever.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates generally to computer graphics systems and moreparticularly to a method and apparatus to more efficiently display andfill a computer generated image on a display screen.

2. Description of the Related Art

The images presented on display screens for portable consumerelectronics are becoming more complex to achieve a higher quality imagepartly in response to the consumer demand for these handheld devices.Devices such as personal digital assistants (PDA), mobile phones,pagers, web tablets, etc., all include small screens for displaying textand graphics. The presentation of the text and graphics on the screenrequires that image lines having a certain width, also referred to as apen width, be accommodated. These image lines, which can be straight orcurved, are displayed on a screen, such as a liquid crystal display(LCD) screen, by defining which pixels are drawn. As the files beingdisplayed on the screens become more complex with a higher resolution,the increased processing demands on the embedded systems of the handhelddevices causes a bottleneck, which in turn, may delay the presentationof the graphical image on the display screen. Additionally, the embeddedsystems for controlling these handheld devices are limited in terms ofmemory and computing power due to their compact nature, which furtheraggravates the bottleneck.

FIG. 1 is an enlarged schematic diagram of a computer generated curvebeing drawn for a display on a computer screen, such as a LCD screen.The curve is defined between lines 100 and 102, which provide theborders between which the image is filled. Pen width 104 is defined asthe distance between lines 100 and 102. Region 106 corresponds to anarea on a display screen that defines a group of pixels. The group ofpixels corresponding to region 106 is filled as the image is drawn on adisplay screen. Once the area defined by region 106 is filled, thefootprint is advanced one unit along line 100, to define another groupof pixels to be filled. The group of pixels corresponding to region 108,which is defined by the footprint as it is advanced one unit, is thendrawn. However, region 110, which is the overlap of regions 106 and 108,is drawn twice in this process. That is, region 110, is written once asdefined by region 106 and is overwritten as defined by region 108,resulting in wasted processing time. This overwriting process isrepeated until the entire graphic is drawn.

Another shortcoming of executing the algorithm for displaying an imagein software as described above, is the amount of overhead associatedwith execution of the algorithm. Thus, the inefficient processing fromthe overwriting of previously drawn pixels mentioned above, comes at ahigh cost in terms of overhead. Furthermore, the handheld devices areconstantly shrinking and being configured to consume less power. Since,the embedded systems controlling these devices is limited in terms ofcomputing power, there is a need to minimize overhead. As productshaving increased resolution and capabilities for displaying complexgraphical images come to market, the processing bottlenecks must beaddressed in order to efficiently display the images without sacrificingthe quality of the display.

As a result, there is a need to solve the problems of the prior art toprovide a method for efficiently processing computer generated graphicalimage data for display and to a hardware acceleration solution tominimize the overhead associated with the software execution.

SUMMARY OF THE INVENTION

Broadly speaking, the present invention fills these needs by providing amethod and system for more efficiently displaying a computer generatedimage on a display screen. It should be appreciated that the presentinvention can be implemented in numerous ways, including as a process, asystem, or a device. Several inventive embodiments of the presentinvention are described below.

In one embodiment, a display controller is provided. The displaycontroller includes image generation circuitry configured to generate anaddress and a color for each pixel of an image to be drawn on a displayscreen. The image generation circuitry includes pen width selectioncircuitry configured to identify and select coordinates of adjacent andnon-overlapping sectors to an initial footprint of the image on thedisplay screen to be drawn. Data processing and selection circuitryconfigured to interface with a central processing unit (CPU) and amemory is also included in the display controller. The data processingand selection circuitry is in communication with the image generationcircuitry and is configured to receive the address and the color foreach pixel of the image.

In another embodiment, a device configured to draw an image is provided.The device includes a central processing unit (CPU) and a random accessmemory (RAM). Drawing engine circuitry in communication with the CPU andthe RAM is included. The drawing engine circuitry includes dataprocessing and selection circuitry and image generation circuitry. Theimage generation circuitry is in communication with the data processingand selection circuitry. The image generation circuitry includes penwidth selection circuitry that enables the efficient display of an imageby defining adjacent, non-overlapping successive sectors used togenerate the image.

In yet another embodiment, a method for drawing a computer generatedimage on a display screen is provided. The method initiates withdefining a footprint region corresponding to a first group of pixels.Then, the first group of pixels is filled. Next, a direction of movementis determined for an image to be presented on a display screen. Then, alocation for an adjacent and non-overlapping sector to the footprintregion is calculated. Next, a second group of pixels corresponding tothe adjacent and non-overlapping sector to the footprint region isfilled.

In still yet another embodiment, a method for filling a computergenerated image on a display screen having defined starting coordinatesis provided. The method initiates with defining a footprint having areference point. Then, a footprint region on a display screen isidentified. The footprint region is defined by the footprint when thereference point corresponds to starting coordinates of an image. Next,pixels associated with the footprint region are filled. Then, a locationfor a sector that is adjacent to and non-overlapping with the footprintregion is calculated. Next, pixels associated with the adjacent sectorare filled. Then, the operations of calculating a location and fillingpixels associated with the adjacent sector are repeated for successivesectors to define the image.

Other aspects and advantages of the invention will become apparent fromthe following detailed description, taken in conjunction with theaccompanying drawings, illustrating by way of example the principles ofthe invention.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention will be readily understood by the followingdetailed description in conjunction with the accompanying drawings, andlike reference numerals designate like structural elements.

FIG. 1 is an enlarged schematic diagram of a computer generated curvebeing drawn for a display on a computer screen.

FIG. 2 is a schematic diagram illustrating the symmetric octants of acircle and their relation to the Bresenham Circle Algorithm (BCA).

FIG. 3A is a schematic diagram representing a process for filling a lineon a display screen in accordance with one embodiment of the invention.

FIG. 3B is an enlarged schematic diagram of the pixels represented byregion 120 and sector 122 of FIG. 3A.

FIG. 4A is a schematic diagram illustrating a process for filling acurve of a computer generated display in accordance with one embodimentof the invention.

FIG. 4B is an enlarged schematic diagram of the pixels represented bysector 146 and region 142 of FIG. 4A.

FIG. 5A is a schematic diagram illustrating one possible location forthe adjacent non-overlapping sectors defined when drawing an image on adisplay screen in accordance with one embodiment of the invention.

FIG. 5B is a schematic diagram illustrating an alternative location forthe adjacent non-overlapping sectors of FIG. 5A due to an alternativedirection of movement.

FIG. 6 is a high level schematic diagram of a printed circuit board forfilling in a computer generated image on a display screen in accordancewith one embodiment of the invention, the printed circuit boardinterfacing with (i) a mobile phone having a display screen capable ofefficiently displaying an image through the components on the printedcircuit board, (ii) a personal digital assistant having a display screencapable of efficiently displaying an image through the components on theprinted circuit board, and (iii) a laptop computer having a displayscreen capable of efficiently displaying an image through the componentson the printed circuit board.

FIG. 7 is a more detailed schematic diagram of the drawing enginecircuitry in accordance with one embodiment of the invention.

FIG. 8 is a more detailed schematic diagram of the data processing andselection circuitry in accordance with one embodiment of the invention.

FIG. 9 is a flowchart diagram of the method operations for drawing acomputer image on a display screen in accordance with one embodiment ofthe invention.

FIG. 10 is a flowchart diagram of the method operations for filling acomputer generated display having defined starting coordinates inaccordance with one embodiment of the invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

An invention is described for an apparatus and method for efficientlydisplaying an image on a computer screen. It will be apparent, however,to one skilled in the art, in light of the following description, thatthe present invention may be practiced without some or all of thesespecific details. In other instances, well known process operations havenot been described in detail in order not to unnecessarily obscure thepresent invention.

The embodiments of the present invention provide a method and apparatusfor creating a computer generated image for display. Inefficiencies,with respect to overwriting previously written pixels, when drawing andfilling a line or curve are eliminated. Additionally, a hardwareacceleration implementation is provided in order to minimize overhead.The Bresenham Circle Algorithm (BCA) is an algorithm employed whendrawing a curved line, also referred to as an arc. The BCA works on theprinciple of splitting a circle into eight octants. The curve iscalculated for one octant and then by adding or subtracting the x or ycoordinate for the calculated octant, the curve can be replicated ineach of the remaining octants.

FIG. 2 is a schematic diagram illustrating the symmetric octants of acircle and their relation to the BCA. The BCA calculates the locationsof the points, i.e., pixels, in the first 45 degree octant, and due tothe symmetrical nature of circle 116, each calculated point in one ofthe octants of the circle can be reflected around each 45 degree axis ofthe circle. For example, the coordinates (x, y) for point 114-1 ofoctant 112-1 are calculated. Due to the symmetry of the circle, thecoordinates for points 114-2 through 114-8 of octants 112-2 through112-8, respectively, can be determined as illustrated in Table 1 below.

TABLE 1 Point Coordinates 114-1 (x, y) 114-2 (y, x) 114-3 (y, −x) 114-4(x, −y) 114-5 (−x, −y) 114-6 (−y, −x) 114-7 (−y, x) 114-8 (−x, y)

The BCA allows for a curve to be generated without regard to the octantin which the curve resides because of the symmetrical nature of acircle. That is, a curve calculated in octant 112-1 can be replicated ineach of the seven remaining octants 112-2 through 112-8 by adding orsubtracting to the x or y coordinates in octant 112-1.

FIG. 3A is a schematic diagram representing a process for filling a lineon a display screen in accordance with one embodiment of the invention.Line 118 defines a pen width 128. Region 120 is defined by an initialfootprint having dimensions equal to pen width 128. That is, the lengthand width of region 120 is equal to pen width 128. For illustrativepurposes, the pen width of line 118 is equal to 3. It should beappreciated by one skilled in the art that any line or curve generatedon a computer display having a pen width greater than 2 will have to befilled. In one embodiment, the initial footprint defining region 120includes a reference point within the region. For exemplary purposes,the initial footprint defining region 120 will use the lower left handpoint 132 as a reference point as long as the reference point isconsistently used for each successive sector. One skilled in the artwill appreciate that any point within region 120 defined by thefootprint can be used as a reference point. Thus, when drawing line 118on a computer display, reference point 132 of region 120 is located onlower line 130 such that the reference point corresponds to a point onthe lower line, which in turn represents a pixel on a display screen.Accordingly, the footprint is positioned to define region 120 such thatreference point 132 corresponds to a point on outline 130. It should beappreciated that region 120 correlates to a group of pixels to be filledon a display screen to present an image. In one embodiment, the image isan outline of a rounded rectangle. For example, the letter “o” displayedon a display screen is an example of an outline of a rounded rectangle.Any portable device having a display screen configured to display text,including numbers, will define arcs and lines that must be filled. Thus,these portable devices can utilize the apparatus and method definedherein.

Still referring to FIG. 3A, the pixels corresponding to region 120 arefilled to define a portion of line 118. Here, as pen width 128 is 3,i.e., 3 pixels, region 120 represents 9 pixels to be filled. Thecoordinates of the footprint defining region 120 on line 118 are known,as well as the coordinates of the reference point on lower line 130.Therefore, the coordinates, i.e., pixels, defined within region 120 canbe ascertained in order to fill the pixels. Rather than advancing thefootprint one unit along outline 130 of line 118, the coordinates for anadjacent, non-overlapping sector to region 120 are calculated. That is,instead of the entire footprint advancing one pen width, i.e., onepixel, at a time to draw line 118, the next sector to be filled can becalculated when a direction of movement is known, as discussed in moredetail with respect to FIGS. 5A and 5B. Hence, sector 122, which isadjacent and non-overlapping to footprint 120, is calculated to definethe next set of pixels to be filled for line 118. In one embodiment, thedirection of movement as indicated by arrow 133 is from left to right,as this is the manner in which the image data is written into memory. Itshould be appreciated that for a straight line the direction of movementcan also be scanned in a right to left direction. Sectors 124 and 126are similarly calculated. It should be appreciated that this processwill be continued until the entire region defined by line 118 on adisplay screen is completely filled in. It will be apparent to oneskilled in the art that the coordinates for a starting point for line118 on a display screen, such as a liquid crystal display (LCD) screen,is supplied by a central processing unit (CPU) writing the startlocation to registers in hardware.

FIG. 3B is an enlarged schematic diagram of the pixels represented byregion 120 and sector 122 of FIG. 3A. As stated above, region 120 has apen width equal to 3 that is, 3 pixels. Thus, 9 pixels are defined byregion 120 as the footprint's dimensions are defined by the pen width.Sector 122 defines 3 pixels which are adjacent to region 120. Theefficiencies gained by calculating the location of sector 122 ratherthan advancing the entire footprint, are fairly significant. That is,sector 122 defines only pixels that have not been filled in yet. Thus,the process described in reference to FIG. 3A is three times faster (9divided by 3) than the process of advancing the footprint by one unit.In particular, when the footprint is advanced one unit along lower line130 according to a pen moving algorithm, another complete set of 9pixels is defined as represented by region 121. The 9 pixels of region121 are then filled. However, this results in the redrawing of 6 pixelswhich had previously been drawn with reference to region 120. Bycalculating the location of sector 122, 3 pixels that have not beenpreviously drawn are filled in, as opposed to 9 pixels defined by region121 when the footprint is advanced one pen width at a time. Thus, thespeed at which 3 pixels defined by region 122 are drawn is three timesas fast as the speed of drawing the 9 pixels defined by region 121.FIGS. 3A and 3B refer to a pen width of 3 for exemplary purposes only,however, it should be appreciated that the pen width can be any numberof pixels suitable for displaying an image on a display screen.

FIG. 4A is a schematic diagram illustrating a process for filling acurve of a computer generated display in accordance with one embodimentof the invention. Curve 154 is defined between lower outline 156 andupper outline 158. Curve 154 defines a pen width 140. For exemplarypurposes, pen width 140 is equal to 5, i.e., 5 pixels. Thus, thefootprint is defined by a length and a width equal to pen width 140. Itshould be appreciated that region 144 is a straight line and thus, couldbe filled according to the process described with reference to FIGS. 3Aand 3B. For illustrative purposes, the curve of FIG. 4A is discussedwith region 142 being a starting point. The initial footprint definesregion 142 and includes a reference point which corresponds to the lowerleft hand corner of the footprint. The reference point of the footprintcorresponds to a point on lower outline 156. Therefore, region 142correlates to a group of pixels to be filled for displaying a portion ofcurve 154 when the reference point corresponds to a point on loweroutline 156. Similar to FIG. 3, the coordinates of the point on outline156 are known, as well as the dimensions of the footprint. Therefore,each coordinate defined within region 142 is also known. In oneembodiment, the direction of movement, as indicated by arrow 152, isbased on the BCA. It will be apparent to one skilled in the art that foroctant 1, in reference to the BCA, the direction of movement is fromleft to right and from the top down and all remaining octants arecalculated based on the values for octant 1. Thus, the next region ofpixels to be filled as represented by sector 146, can be calculated.These calculations can be repeated for successive points on outline 156to result in sectors 148, 150 and so on, being defined and filled.

It should be appreciated that while FIG. 4A illustrates a curve beinggenerated, the process for filling a curve can be applied to anysuitable shape having a curve. In particular, the process can beperformed to display a rounded rectangle. Furthermore, once one of therounded edges of a rounded rectangle is drawn, the coordinates for thepixels defining the remaining rounded edges can be calculated and filledby utilizing the Bresenham Circle Algorithm discussed above.Additionally, text and graphics containing a straight line or a curvecan apply the process for calculating adjacent, non-overlapping regionsto be filled based upon a direction of movement.

FIG. 4B is an enlarged schematic diagram of the pixels represented bysector 146 and region 142 of FIG. 4A. Sector 146 corresponds to pixelsA-I of FIG. 4A. The remaining pixels of FIG. 4B, i.e., 1-9 and P1-P16,represent the pixels defined by region 142 of FIG. 4A. As the locationsof pixels A through I are calculated, it is unnecessary to define theentire footprint and overwrite pixels that have already been drawn.Pixels P1 to P16 were previously drawn by region 142 of FIG. 4A. Thus,by calculating the coordinates of sector 146, 9 pixels are drawn ratherthan 25 pixels, which results in a significant processing efficiencythrough the elimination of the redrawing of pixels P1 to P16. Thisprocess is approximately 2.78 times (25 divided by 9) faster than thetechnique of redrawing previously drawn pixels.

FIG. 5A is a schematic diagram illustrating one possible location forthe adjacent non-overlapping sectors defined when drawing an image on adisplay screen in accordance with one embodiment of the invention.Region 159 represents the region defined by the initial footprint suchas region 120 of FIG. 3A and region 142 of FIG. 4A. For the situationwhere the direction of movement is one over, i.e., one unit over on thex axis, as indicated by directional arrow 161, sector 160-1 and sector160-2 are drawn and filled. The location of sectors 160-1 and 160-2 canbe calculated since the x coordinate for the points of line 157 is the xcoordinate of reference point 159-1 plus the pen width of region 159.Thus, the x coordinates for the lower left hand corner of sector 160-1and sector 160-2 can be determined. The width for sectors 160-1 and160-2 is one pixel, i.e., one pen width. Therefore, the dimensions forsectors 160-1 and 160-2 can be stored, which allows the pixelscorresponding to sectors 160-1 and 160-2 to be identified. When movingaccording to directional arrow 161, the pixels corresponding to sectors160-1 and 160-2 are drawn. It should be appreciated that the abovedescribed process for determining the location of sectors 160-1 and160-2 allows for the drawing of a line moving in a direction asdiscussed with reference to FIGS. 3A and 3B.

Still referring to FIG. 5A, where movement is according to directionalarrow 163, one pixel over and one pixel down, in other words, one unitover on the x axis and one unit down on the y axis, the pixelscorresponding to sectors 160-2 and 160-3 are drawn. Since the xcoordinate for sector 160-3 is one pen width over from the x coordinateof reference point 159-1 and the y coordinate is the y coordinate ofreference point 159-1 minus one pixel length, the x and y coordinates ofthe lower left hand corner of sector 160-3 can be calculated. Asmentioned above, the dimensions of sector 160-3 are stored in memory inone embodiment. Sectors 160-2 and 160-3 are drawn when moving one pixelover and one pixel down. A location for sector 160-2 is calculated asdiscussed above. It should be appreciated that sector 160-2 iscalculated and filled irrespective of the direction of movement. Thus,by calculating the coordinates of the lower left hand corners of sectors160-1 through 160-3 and using the calculated coordinates in conjunctionwith the stored dimensions of sectors 160-1 through 160-3, the pixelscorresponding to sectors 160-1 through 160-3 are identified. Dependingon a direction of movement, the pixels corresponding to sectors 160-1 or160-3 are drawn along with the pixels corresponding to sector 160-2.Consequently, the overwriting of previously drawn pixels is eliminated.One skilled in the art will appreciate that by applying the BCA to theprocess described herein, once the points in the first octant arecalculated, the points on the circle for any other octant can becalculated by adding and subtracting the x and y coordinates asdiscussed with respect to FIG. 2.

FIG. 5B is a schematic diagram illustrating an alternative location forthe adjacent non-overlapping sectors of FIG. 5A due to an alternativedirection of movement. It should be appreciated that FIG. 5B is a 90degree rotation of FIG. 5A. Thus, sectors 160-1 and 160-2 are drawn fora line moving in a downward direction, i.e., the y coordinate isdecreasing. Sectors 160-2 and 160-3 are drawn for a curve proceeding asdepicted by arrow 163. As mentioned above, the image represented by FIG.5B can be displayed by applying the BCA to the image of FIG. 5A. Thatis, the curve of FIG. 5B occupies a different octant than the curve ofFIG. 5A, however, by adding and subtracting x and y coordinates, thecoordinates for the curve of FIG. 5B can be ascertained through the BCA.It should be appreciated that curves defined by FIGS. 5A and 5B may berotated in 90 degree increments through the application of the BCA,thereby allowing for 360 degree directionality. That is, a curve can bedefined by any one of the octants of a circle, such as the circle ofFIG. 2 through the application of the BCA.

FIG. 6A is a high level schematic diagram of a printed circuit board forfilling in a computer generated image on a display screen in accordancewith one embodiment of the invention. Printed circuit board (PCB) 169includes central processing unit (CPU) 162, display controller 164 andstatic random access memory (SRAM) 168. CPU 162 is in communication withdisplay controller 164. Display controller 164 is in communication withSRAM 168. In one embodiment, display controller 164 is a liquid crystaldisplay (LCD) controller that enables the presentation of a computergenerated image on a LCD screen. Of course, an image stored in SRAM 168can be displayed on a display screen that is in communication with theSRAM. Drawing engine circuitry (DEC) 166 is defined within displaycontroller 164. Drawing engine circuitry 166 includes circuitryconfigured to incrementally fill in the regions of a line or a curvewithout overlapping any previously drawn regions or sectors, asmentioned above in reference to FIGS. 3A, 3B, 4A and 4B.

The printed circuit board of FIG. 6 may be included in a portableelectronic device such as a personal digital assistant, mobile phone,web tablet, etc. For example, the printed circuit board may interfacewith a mobile phone having PCB 169 that enables a display screen of themobile phone to display an image as described with respect to FIGS. 3A,3B, 4A and 4B, or a PDA or laptop, each having PCB 169 to enable theefficient display of an image on a display screen for that device. Itshould be appreciated that in one embodiment of the invention, the codeof Table 2 below can be stored in memory, such as a flash memory of eachdevice. The flash memory would be in communication with CPU 162 of FIG.6. CPU 162 can then store the code in cache and execute the code. In oneembodiment, PCB 169 is part of an embedded system for a handheld device.

FIG. 7 is a more detailed schematic diagram of the drawing enginecircuitry in accordance with one embodiment of the invention. Drawingengine circuitry 166 includes image generation circuitry 172, dataprocessing and selection circuitry 178, and control block circuitry 176.Drawing engine circuitry 166 is configured to interface with centralprocessing unit (CPU) 162 and static random access memory (SRAM) 168.SRAM 168 is in communication with display screen 171. In one embodiment,display screen 171 is a liquid crystal display (LCD) screen. CPU 162 isin communication with storage media 170 and is configured to issue writedata to data processing and selection circuitry 178. CPU write dataincludes the coordinates for a starting location of an image to be drawnon a display screen. CPU write data is converted and aligned by dataprocessing and selection circuitry 178 as will be explained in moredetail with reference to FIG. 8. Image generation circuitry 172, outputsa color for each pixel to be drawn as represented by data 173, and aphysical address 175 in memory of where each pixel to be drawn isduplicated. Image generation circuitry 172 includes pen width selectioncircuitry 174. Pen width selection circuitry 174 is configured to selecta pen width for each region of an image to be drawn on a display screen.For example, with respect to FIGS. 3A, 3B, 4A and 4B, the pen widthselection circuitry 174 provides a pen width for the footprint, and eachsuccessive adjacent non-overlapping sector from the footprint region asthe image is drawn.

It will be apparent to one skilled in the art that image generationcircuitry 172 and pen width selection circuitry 174 of FIG. 7 includecounters, comparators, adders, subtractors and logic gates fabricated onsemiconductor chips and configured to accomplish the mathematicaloperations required to draw a line or a curve on a display screen.Because the Bresenham circle algorithm is employed to locate coordinatesfor the pixels, complex mathematical computations such as squares,square roots, sign and co-sign functions are avoided. Thus, thecircuitry within image generation circuitry 172 can be smaller andconfigured to more rapidly generate the image. In one embodiment, imagegeneration circuitry 172 is configured to execute the code supplied inTable 2 for drawing an image on a display screen as discussed withreference to FIGS. 5A and 5B. Accordingly, each successive sector drawnon the display screen will be adjacent to a prior drawn sector withoutoverlapping. That is, the address of each pixel is not written thenoverwritten, thereby avoiding a significant processing inefficiency fordrawing an image on a display screen. Control block circuitry 176 isconfigured to manage signals between data processing and selectioncircuitry 178 and image generation circuitry 172.

FIG. 8 is a more detailed schematic diagram of the data processing andselection circuitry in accordance with one embodiment of the invention.Data processing and selection circuitry 178 is configured to receive CPUwrite data and SRAM read data. Source data alignment circuitry 182aligns source data from any byte aligned address to a double word (32)bit address. Source data alignment circuitry 182 outputs source readdata to multiplexor 186. Data 173, i.e., the color of each pixel, fromimage generation circuitry 172, is multiplexed with the source read datainto multiplexor 186, where the multiplexor selects the source of thedata to use. That is, either the data from source data alignmentcircuitry 182 or data 173 from image generation circuitry 172 isselected. The selected data from multiplexor 186 is output todestination data alignment circuitry 184. Destination data alignmentcircuitry 184 aligns the data from the double word to the byte addressin the SRAM. Destination data alignment circuitry 184 outputs data toraster operation (ROP) code circuitry 188 and byte enable data totransparency circuitry 194. It will be apparent to one skilled in theart that raster operation code circuitry 188 allows data to be read froma destination before writing to it. For example, ROP code circuitry 188enables the feature of changing an icon's color on a display screen asit is clicked on or dragged. Transparency circuitry 194 compares thedata with a transparent color and determines whether the data is writtenor not. Raster operation code 188 outputs raster operation result datato first in first out (FIFO) buffer 190. FIFO buffer 190 is a bufferwhere data and byte enables can reside until a memory controller isfree. When the memory controller is free, the data can be written intomemory. For example, for a 32 bit write, byte enable FIFO 194 defineswhich 8 bits of the 32 bits of data to write into memory in oneembodiment. One skilled in the art will appreciate that data in FIFObuffer 190 can be read by a CPU. Address generation circuitry 192 isconfigured to receive address data 175 for pixels to be drawn on thedisplay screen in order to display the image. Address generationcircuitry 192 outputs the pixel addresses to an SRAM address.

FIG. 9 is a flowchart diagram of the method operations for drawing acomputer image on a display screen in accordance with one embodiment ofthe invention. The flowchart initiates with operation 200 where aninitial footprint region corresponding to a first group of pixels isdefined. The initial footprint region has dimensions defined by a penwidth. In one embodiment, the pen width is greater than 2. The methodthen advances to operation 202 where the first group of pixels isfilled. As mentioned above, the address and the color for each pixel issupplied by pen width selection circuitry of a display controller, suchas a LCD controller.

The method then moves to operation 204 where a direction of movement isdetermined. The direction of movement as discussed with respect to FIGS.3A, 3B, 4A, 4B, 5A and 5B is determined here. In one embodiment, thedirection of movement is determined based on the BCA. The method thenproceeds to operation 206 where a location for an adjacent andnon-overlapping sector to the initial footprint region is calculated.With reference to FIGS. 5A and 5B, the location of sectors 160-1 through160-3 are calculated here. As described above, since the direction ofmovement is known and the starting coordinates of the adjacent sectorsare known, a location of the adjacent sectors not overlapping theinitial footprint can be calculated. The method then advances tooperation 208 where a second group of pixels corresponding to theadjacent and non-overlapping sector is filled. Referring back to FIGS.4A and 4B, the pixels defined by sector 146 would be filled here. Thus,only pixels that have not been filled are defined by the adjacentsector. It should be appreciated that since the initial footprint regionand the sector are adjacent without overlapping, the processing time isnot wasted on writing over a previously written pixel.

FIG. 10 is a flowchart diagram of the method operations for a method tofill a computer generated display having defined starting coordinates inaccordance with one embodiment of the invention. The flowchart diagraminitiates with operation 210 where a footprint having a reference pointis defined. In one embodiment, the footprint has dimensions defined by apen width. The reference point of the footprint can be any point withinthe footprint, such as a corner or a center of the footprint. The methodthen advances to operation 212 where a footprint region associated witha display screen is identified. The footprint region is defined by thefootprint when the reference point corresponds to the startingcoordinates. For example, in reference to FIGS. 3A and 4A, the footprintdefined for each of these figures contains a reference point in thelower left hand corner. The reference point of the footprint is placedat the coordinates defined by the starting coordinates to define thefootprint region. It will be apparent to one skilled in the art that thestarting coordinates are provided by the CPU. As mentioned above, anypoint within the footprint can be used as a reference point as long asthat point is consistently used as the reference point.

The method of FIG. 10 then proceeds to operation 214, where the pixelsof the footprint regions are filled. Thus, the pixels contained withinthe region defined by the footprint of FIGS. 3A, 3B, 4A and 4B would befilled here. The method then moves to operation 216 where a location fora sector that is adjacent to the footprint region is calculated. Here,the adjacent sector does not overlap the footprint region. In oneembodiment, a direction of movement is determined when calculating alocation for an adjacent sector. One skilled in the art will appreciatethat where the Bresenham circle algorithm is applied, the curve can bedrawn in any of the octants of a circle. That is, the symmetry of acircle allows for the curve having a radius of the circle to becalculated for one octant of the circle and then, through addition orsubtraction of the x and y coordinates, any direction of movement of thearc or curve can be displayed. The method then advances to operation 218where the pixels of the adjacent sector are filled. Here, previouslywritten pixels are not overwritten, thereby allowing for more efficientprocessing. The method then proceeds to operation 220 where thecalculating and the filling of the pixels for each successive adjacentsector is repeated until the entire image is displayed. In oneembodiment, the image is displayed on a LCD screen of a handheld device.

Table 2, below, includes illustrative code for filling an image of anarc or a curve on a display screen in accordance with one embodiment ofthe invention. Of course, the code can take on any form, so long as thefilling function is performed in an adjacent and non-overlapping manner.It should be appreciated that the code defined in Table 2 may have to beadapted to be integrated with a particular operating system of a deviceincorporating the code. However, the functionality defined by the codei.e., defining successive adjacent and non-overlapping sectors to befilled for a computer generated image, remains the same irrespective ofthe operating system.

TABLE 2 int [8:0] x, y, radius; int [20:0] memaddress; int [10:0]deltaB; int [11:0] d, deltaSE; int DrawRoundedRectangle (int Radius, / /Radius in terms of pixels int CentreX, / / Start X location in thecentre of the rounded / / rectangle int CentreY, / / Start Y location inthe centre of the rounded / / rectangle int Width, / / Width ofrectangle int Height, / / Height of Rectangle int Color, / / Drawn Colorint ScreenWidth, / / Width of the screen in terms of bytes int PenWidth)/ / Width of the drawn line in terms of / / pixels  { X = 0; Y = Radius;D = 1 − Radius; DeltaE = 3; DeltaSE = 5 − (2 * Radius); HalfWidth =Width / 2; HalfHeight = Height / 2; LeftX = CentreX − HalfWidth +Radius; RightX = CentreX + HalfWidth − Radius; TopY = CentreY −HalfHeight + Radius; BottomY = CentreY + HalfHeight − Radius; / / drawleft line DrawLine (CentreX − HalfWidth, TopY, CentreX − HalfWidth,BottomY, PenWidth) ; / / draw right line DrawLine (CentreX + HalfWidth,TopY, CentreX + HalfWidth, BottomY, PenWidth) ; / / draw top lineDrawLine (LeftX, CentreY − HalfHeight, RightX, CentreY −HalfHeight,PenWidth) ; / / draw bottom line DrawLine (LeftX, CentreY +HalfHeight, RightX, CentreY + HalfHeight,PenWidth) ; / / on first timedraw a full rectangle DrawAllOctants (LeftX, RightX, TopY, BottomY, X,Y, Color,PenWidth, ScreenWidth) while (Y > X) { / / Draw Sector 2DrawAllSector2 (LeftX, RightX, TopY, BottomY, X, Y,Color,PenWidth,ScreenWidth) ; if (D < 0) { / / determine where to placethe pixel D = D + DeltaE; DeltaE = DeltaE + 2; DeltaSE + DeltaSE + 2;DrawAllSector1 (LeftX, RightX, TopY, BottomY, X, Y,Color,PenWidth,ScreenWidth) ; } else { D = D + DeltaSE; DeltaE =DeltaB + 2; DeltaSE = DeltaSE + 4; Y−−; / / move Y pixel down 1DrawAllSector3 (LeftX, RightX, TopY, BottomY, X, Y,Color,PenWidth,ScreenWidth) ; } X++; / / advance to next x coordinate }} int DrawAllSector2 (LeftX, RightX, TopY, BottomY, X, Y,Color,PenWidth,ScreenWidth) { / / Draw all 8 octants of the circle / /draw octant 1 DrawLine (RightX + X + PenWidth, TopY − Y, RightX + X +PenWidth, TopY − Y − PenWidth + 1, Color,ScreenWidth); / / draw octant 2DrawLine (RightX + Y, TopY − X − PenWidth, RightX + Y + PenWidth − 1,TopY − X − PenWidth,Color,ScreenWidth); / / draw octant 3 DrawLine(RightX + Y, BottomY + RightX + Y + PenWidth − 1, BottomY + Y + PenWidth− 1, Color,ScreenWidth); / / draw octant 4 DrawLine (RightX + X +PenWidth, BottomY + Y, RightX + X + PenWidth, BottomY + Y + PenWidth −1, Color,ScreenWidth); / / draw octant 5 DrawLine (LeftX − X − PenWidth,BottomY + Y, LeftX − X − PenWidth, BottomY + Y + PenWidth − 1,Color,ScreenWidth); / / draw octant 6 DrawLine (LeftX − Y, BottomY + X +PenWidth, LeftX − Y − PenWidth − 1, BottomY + X +PenWidth,Color,ScreenWidth); / / draw octant 7 DrawLine (LeftX − Y, TopY− X, LeftX + Y + PenWidth − 1, TopY − X − PenWidth,Color,ScreenWidth); // draw octant 8 DrawLine (LeftX − X − PenWidth, TopY − Y,LeftX − X −PenWidth, TopY − Y − PenWidth + 1, Color,ScreenWidth); } intDrawAllSector1 (LeftX, RightX, TopY, BottomY, X, Y, Color, PenWidth,ScreenWidth) { / / Draw all 8 octants of the circle / / draw octant 1DrawPoint (RightX + X + PenWidth, TopY − Y − PenWidth,Color,ScreenWidth)/ / draw octant 2 DrawPoint (RightX + Y + PenWidth, TopY − X −PenWidth,Color,ScreenWidth) / / draw octant 3 DrawPoint (RightX + Y +PenWidth, BottomY + X + PenWidth,Color,ScreenWidth) / / draw octant 4DrawPoint (RightX + X + PenWidth, BottomY + Y +PenWidth,Color,ScreenWidth) / / draw octant 5 DrawPoint (LeftX − X −PenWidth, BottomY + Y + PenWidth,Color,ScreenWidth) / / draw octant 6DrawPoint (LeftX − Y − PenWidth, BottomY + X +PenWidth,Color,ScreenWidth) / / draw octant 7 DrawPoint (LeftX − Y −PenWidth, BottomY − X − PenWidth,Color,ScreenWidth) / / draw octant 8DrawPoint (LeftX − X − PenWidth, BottomY − Y −PenWidth,Color,ScreenWidth) } int DrawAllSector3 (LeftX, RightX, TopY,BottomY, X, Y, Color,PenWidth,ScreenWidth) { / / Draw all 8 octants ofthe circle / / draw octant 1 DrawLine (RightX + X + 1, TopY − Y + 1,RightX + X + PenWidth, TopY − Y − 1, Color, ScreenWidth) ; / / drawoctant 2 DrawLine (RightX + Y − 1, TopY − X − 1, RightX + Y − 1, TopY −Y − PenWidth,Color,ScreenWidth); / / draw octant 3 DrawLine (RightX + Y− 1, BottomY + X + 1, RightX + Y − 1, BottomY + Y +PenWidth,Color,ScreenWidth); / / draw octant 4 DrawLine (RightX + X + 1,BottomY + Y − 1, RightX + X + 1, BottomY + Y −PenWidth,Color,ScreenWidth); / / draw octant 5 Drawline (LeftX − X − 1,BottomY + Y − 1, LeftX − X − 1, BottomY + Y −PenWidth,Color,ScreenWidth) ; / / draw octant 6 DrawLine (LeftX − Y −1,BottomY + X + 1,LeftX − Y − 1, BottomY + Y +PenWidth,Color,ScreenWidth) ; / / draw octant 7 DrawLine (LeftX − Y +1,TopY − X − 1,LeftX − Y + 1, TopY − Y − PenWidth,Color,ScreenWidth); // draw octant 8 DrawLine (LeftX − X + 1,TopY − Y + 1,LeftX − X + 1, TopY− Y − 1,Color,ScreenWidth); }

The code defined in Table 2 draw sector 2, which corresponds to sector160-2 of FIGS. 5A and 5B, each time. Then, the direction of movement isdetermined through the variable D. That is, if D is less than 0, thensector 1, which corresponds to sector 160-1 of FIGS. 5A and 5B, isdrawn. When sector 1 is drawn the direction of movement is one pixelover as illustrated in FIGS. 3A and 3B. If D is not less than 0 thensector 3, which corresponds to sector 160-3 of FIGS. 5A and 5B, isdrawn. When sector 3 is drawn the direction of movement is one pixelover and one pixel down as illustrated in FIGS. 4A and 4B. As mentionedabove, once the curve is drawn in one octant, the curve can bereplicated in any of the other 7 octants through the Bresenham CircleAlgorithm, as discussed above with respect to FIG. 2.

The code of Table 2 is executed through hardware logic in one embodimentof the invention. One skilled in the art will appreciate that it ispossible to synthesize code to generate circuitry for carrying out thelogic and the operations of code for efficiently displaying an image,such as the code listed in Table 2. The circuitry carrying out the logicand operations of the code is defined by transistors, logic gates, etc.,fabricated on semiconductor chips. Furthermore, the image generationcircuitry includes counters, comparators, adders and subtractors toaccomplish the mathematical functions in order to define and fill theadjacent, non-overlapping sectors. In order to design the hardwarelogic, Table 3 below provides an exemplary listing of the register sizesfor each variable for one embodiment of the invention. It should beappreciated that Table 3 is listed for exemplary purposes only and notmeant to be limiting, as the register sizes will change depending on thewidth and length of the image.

TABLE 3 Variable name Register Size (bits) x 10 y 10 D deltaE 11 deltaSE12 radius 10 color 16 memaddress 21

It should be appreciated that the method and apparatus for filling ascreen described above can also be accomplished by drawing the pixelsfor a line of the curve. That is, the footprint is defined and thereference point is moved along a line of the curve through a suitablepen moving algorithm. At each point along the line the reference pointcorresponds to a pixel which is drawn. Once one line is completed theradius is increased and the footprint is moved along the curve definedby the increased radius, drawing pixels at each point. This is repeateduntil the width of the curve is filled.

The above described invention may be practiced with other computersystem configurations including hand-held devices, microprocessorsystems, microprocessor-based or programmable consumer electronics,minicomputers, mainframe computers and the like. While the invention hasbeen described in relation to the embedded systems of handheld devices,it should be appreciated that the invention may also be used withdesktop and laptop computing systems.

With the above embodiments in mind, it should be understood that theinvention may employ various computer-implemented operations involvingdata stored in computer systems. These operations are those requiringphysical manipulation of physical quantities. Usually, though notnecessarily, these quantities take the form of electrical or magneticsignals capable of being stored, transferred, combined, compared, andotherwise manipulated. Further, the manipulations performed are oftenreferred to in terms, such as producing, identifying, determining, orcomparing.

Any of the operations described herein that form part of the inventionare useful machine operations. The invention also relates to a device oran apparatus for performing these operations. The apparatus may bespecially constructed for the required purposes, or it may be a generalpurpose computer selectively activated or configured by a computerprogram stored in the computer. In particular, various general purposemachines may be used with computer programs written in accordance withthe teachings herein, or it may be more convenient to construct a morespecialized apparatus to perform the required operations.

The invention can also be embodied as computer readable code on acomputer readable medium. The computer readable medium is any datastorage device that can store data which can be thereafter be read by acomputer system. Examples of the computer readable medium include harddrives, network attached storage (NAS), read-only memory, random-accessmemory, CD-ROMs, CD-Rs, CD-RWs, magnetic tapes, and other optical andnon-optical data storage devices. The computer readable medium can alsobe distributed over a network coupled computer systems so that thecomputer readable code is stored and executed in a distributed fashion.

Although the invention has been described in some detail for purposes ofclarity of understanding, it will be apparent from the foregoingdescription that certain changes and modifications may be practicedwithin the scope of the appended claims. Accordingly, the presentembodiments are to be considered as illustrative and not restrictive,and the invention is not to be limited to the details given herein, butmay be modified within the scope and equivalents of the appended claims.

1. A display controller, the controller comprising: image generationcircuitry configured to generate an address and a color for each pixelof an image to be drawn on a display screen, the image generationcircuitry including: pen width selection circuitry configured toidentify an initial footprint of the image on the display screen to bedrawn, the pen width selection circuitry further configured to define anoverlapping footprint to the initial footprint, wherein the pen widthselection circuitry identifies within the overlapping footprint a sectorto be drawn, the sector being adjacent and non-overlapping to theinitial footprint; and data processing and selection circuitryconfigured to interface with a central processing unit (CPU) and amemory, the data processing and selection circuitry in communicationwith the image generation circuitry and configured to receive theaddress and the color for each pixel of the image.
 2. The displaycontroller of claim 1, further including: control block circuitry incommunication with the image generation circuitry and the dataprocessing and selection circuitry, the control block circuitryconfigured to manage signals between the image generation circuitry andthe data processing and selection circuitry.
 3. The display controllerof claim 1, wherein the pen width selection circuitry includes adders,subtractors, counters and comparators.
 4. The display controller ofclaim 1, wherein the data processing and selection circuitry isconfigured to allow data to be read from a destination before writing tothe destination.
 5. The display controller of claim 1, wherein the penwidth selection circuitry defines a pen width for each footprint, eachfootprint defining a region of pixels to be drawn.
 6. The displaycontroller of claim 1, wherein the display controller is a component ofan embedded system.
 7. The display controller of claim 6, wherein theembedded system controls a portable handheld electronic device.
 8. Adevice configured to display an image, the device comprising: a centralprocessing unit (CPU); a random access memory (RAM); and drawing enginecircuitry in communication with the CPU and the RAM, the drawing enginecircuitry including: data processing and selection circuitry; and imagegeneration circuitry in communication with the data processing andselection circuitry, the image generation circuitry including pen widthselection circuitry, the pen width selection circuitry enabling drawingof an image by identifying an initial footprint of the image to bedrawn, the pen width selection circuitry further configured to define anoverlapping footprint to the initial footprint, wherein the pen widthselection circuitry identifies within the overlapping footprint a sectorto be drawn, the sector being adjacent and non-overlapping to theinitial footprint.
 9. The device of claim 8, wherein the pen widthselection circuitry defines a pen width for each footprint, eachfootprint defining a region of pixels to be drawn.
 10. The device ofclaim 8, wherein the pen width selection circuitry is configured todetermine a direction of movement for the through the Bresenham circlealgorithm.
 11. The device of claim 8, wherein the drawing enginecircuitry further includes: control block circuitry in communicationwith the image generation circuitry and the data processing andselection circuitry, the control block circuitry configured to managesignals between the image generation circuitry and the data processingand selection circuitry.
 12. The device of claim 8, wherein the dataprocessing and selection circuitry is configured to allow data to beread from a destination before writing to the destination.
 13. Thedevice of claim 8, wherein the image is displayed on a liquid crystaldisplay (LCD) screen.
 14. The device of claim 8, wherein the drawingengine circuitry is a component of a liquid crystal display (LCD)controller.
 15. A method for drawing a computer generated image on adisplay screen, the method comprising: defining a footprint regioncorresponding to a first group of pixels; filling the first group ofpixels; determining a direction of movement of an image to be presentedon a display screen; defining a next footprint region in the directionof movement partially overlapping the footprint region; calculating alocation within the next footprint region for an adjacent andnon-overlapping sector to the footprint region; and filling a secondgroup of pixels corresponding to the adjacent and non-overlapping sectorto the footprint region.
 16. The method of claim 15, wherein the methodoperation of determining a direction of movement of an image to bepresented on a display screen further includes: applying a Bresenhamcircle algorithm to define points on a curve.
 17. The method of claim15, wherein the computer generated image is a rounded rectangle.
 18. Themethod of claim 15, wherein dimensions of the footprint region aredefined by a pen width.
 19. The method of claim 15, wherein the methodoperation of defining a footprint region corresponding to a first groupof pixels further includes: projecting a footprint to define thefootprint region, such that a reference point of the footprint regioncorresponds to starting coordinates of the computer generated image onthe display screen.
 20. The method of claim 15, wherein the methodoperation of calculating a location within the next footprint region foran adjacent and non-overlapping sector to the footprint region furtherincludes: providing a color and an address for each pixel defined by theadjacent and non-overlapping sector.
 21. The method of claim 15, whereinthe adjacent, non-overlapping sector is one pixel wide.
 22. The methodof claim 15, wherein the computer generated image is a roundedrectangle.
 23. A method for filling a computer generated image on adisplay screen having defined starting coordinates, the methodcomprising: defining a footprint having a reference point; identifying afootprint region on a display screen, the footprint region defined bythe footprint when the reference point corresponds to startingcoordinates of an image; filling pixels associated with the footprintregion; defining a next footprint region overlapping the footprint;calculating a location for a sector within the next footprint regionthat is adjacent to and non-overlapping with the footprint region;filling pixels associated with the adjacent sector; and repeating theoperations of calculating a location for a sector within the nextfootprint region that is adjacent to and non-overlapping with thefootprint region and filling pixels associated with the adjacent sectorfor successive sectors to define the image.
 24. The method of claim 23,wherein the method operation of calculating a location for a sectorwithin the next footprint region that is adjacent to and non-overlappingwith the footprint region further includes: determining a direction ofmovement from the starting coordinates; and providing a color and anaddress for each pixel defined by the adjacent and non-overlappingsector.
 25. The method of claim 24, wherein the method operation ofdetermining a direction of movement from the starting coordinatesfurther includes: applying a Bresenham circle algorithm to draw thecomputer generated image, wherein the computer generated image is anarc.
 26. The method of claim 23, wherein dimensions of the footprint aredefined by a pen width.
 27. The method of claim 26, wherein thefootprint is a square.
 28. The method of claim 27, wherein the referencepoint is defined by a point located within a corner of the square. 29.The method of claim 23, wherein the sector is one pixel wide.
 30. Themethod of claim 23, further including: displaying the image on a displayscreen.
 31. The method of claim 30, wherein the display screen is aliquid crystal display screen.
 32. The method of claim 23, wherein thecomputer generated image is a rounded rectangle.